/* 
 * File:   LogFileStream.h
 * Author: ekto
 *
 * Created on 12 Μάρτιος 2011, 1:37 πμ
 */

#ifndef LOGFILESTREAM_H
#define	LOGFILESTREAM_H

#include "Vector2.h"
#include "Rect.h"
#include "Circle.h"

#include <list>
#include <fstream>

class LogFileStream : public std::ofstream
{
public:

    /**
     * Error Level ids.
     */
    enum LEVEL
    {
        LEVEL_ERROR,
        LEVEL_WARNING,
        LEVEL_NOTE
    };

    /**
     * Writes a new line with a timestamp and returns the stream for the user to start logging.
     * @param level The level id. Use the LogFileStream::LEVEL_* enum values.
     * @return The stream ready to accept external values.
     */
    LogFileStream& Log(int level = LEVEL_NOTE);
private:
    /**
     * Returns the current full time as a string.
     * @return
     */
    std::string Now();
};

/*
 * Overloaded stream operators used to print out engine specific classes easily.
 */

std::ostream& operator << (std::ostream& stream,const Math::Vector2I& vector);
std::ostream& operator << (std::ostream& stream,const Math::Vector2F& vector);
std::ostream& operator << (std::ostream& stream,const Math::Vector2D& vector);
std::ostream& operator << (std::ostream& stream,const Math::Circle& circle);
std::ostream& operator << (std::ostream& stream,const Math::Rect& rect);
std::ostream& operator << (std::ostream& stream,const std::list<std::string>& list);

#endif	/* LOGFILESTREAM_H */

